package com.tenement.netty.service.impl;

import com.tenement.entity.ChatModel;
import com.tenement.netty.service.ChatHandlerService;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;

import java.util.Map;
import java.util.Set;

public class OfflineServiceImpl implements ChatHandlerService {
    @Override
    public void execute(ChatModel chatModel, ChannelHandlerContext channelHandlerContext,
                        Map<String, Channel> privateChannel, Set<Channel> channelGroups) {
        privateChannel.remove(chatModel.getUserId().toString());
        channelGroups.remove(channelHandlerContext.channel());
    }
}
